home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1994 August: Tool Chest / Dev.CD Aug 94.toast / Tool Chest / Games / Mac Game Developer's Handbook / Compatibility / Compatability Guidelines / Compatability Guidelines
Encoding:
Text File  |  1993-04-21  |  30.9 KB  |  37 lines  |  [ONLN/HLX2]

  1. Compatibility Guidelines
  2. Overview    m.ov.compatibility
  3. Revised by:    Louella Pizzuti    February  1987
  4. Written by:    Cary Clark     January 1986
  5.         Scott Knaster     
  6. Apple has many enhancements planned for the Macintosh family of computers. To help ensure your software’s compatibility with these enhancements, check each item in this note to be sure that you’re following the recommendations.
  7. If your software is written in a high-level language like Pascal or C and if you adhere to the guidelines listed in Inside Macintosh, many of the questions in this note won’t concern you. If you develop in assembly language, you should read each question carefully. If you answer any question “yes,” your software may encounter difficulty running on future Macintosh computers, and you should take the recommended action to change your software.
  8. Do you depend on 68000 instructions which require that the processor be in supervisor mode?
  9. In general, your software should not include instructions which depend on supervisor mode. These include modifying the contents of the status register. Most programs which modify the status register are only changing the Condition Code Register (CCR) half of the status register, so an instruction which addresses the CCR will work fine. Also, your software should not use the User Stack Pointer (USP) or turn interrupts on and off.
  10. Do you have code which executes in response to an exception and relies on the position of data in the exception’s local stack frame?
  11. Exception stack frames vary on different microprocessors in the 68000 family, some of which may be used in future Macintosh computers. You should avoid using the TRAP instruction. Note: You can determine which microprocessor is installed by examining the low-memory global CPUFlag (a byte at $12F). These are the values:
  12.     
  13.     CPUFlag    microprocessor
  14.       $00        68000
  15.       $01        68010
  16.       $02        68020
  17.       $03        68030
  18. Do you use low-memory globals not documented in Inside Macintosh?
  19. Other microprocessors in the 68000 family use the exception vectors in locations $0 through $FF in different ways. No undocumented location below the system heap ($100 through $13FF) is guaranteed to be available for use in future systems.
  20. Do you make assumptions about the file system which are not consistent with both the original Macintosh File System and the Hierarchical File System?
  21. Your applications should be compatible with both file systems. The easiest way to do this is to stick to the old files system trap calls (which work with both file systems) and avoid direct manipulation of data structures such as file control blocks and volume control blocks whenever possible.
  22. Do you depend on the system or application heaps starting at a hard-coded address?
  23. The starting addresses and the size of the system and application heaps has already changed (Macintosh vs. Macintosh Plus) and will change again in the future. Use the global ApplZone to find the application heap and SysZone to find the system heap. Also, don’t count on the application heap zone starting at an address less than 65536 (that is, a system heap smaller than 64K).
  24. Do you look through the system’s queues directly?
  25. In general, you should avoid examining queue elements directly. Instead, use the Operating System calls to manipulate queue elements.
  26. Do you directly address memory-mapped hardware such as the VIA, the SCC, or the IWM?
  27. You should avoid accessing this memory directly and use trap calls instead (disk driver, serial driver, etc.). Future machines may include a memory management unit (MMU) which may prevent access to memory-mapped hardware. Also, these memory-mapped devices may not be present on future machines. The addresses of these devices are likely to change, so if you must access the hardware directly, get the base address of the device from the appropriate low-memory global (obtainable from includes and interface files):
  28.     device        global        
  29.     VIA        $1D4
  30.     SCCRd        $1D8
  31.     SCCWr    $1DC
  32.     IWM        $1E0
  33. Do you assume the location or size of the screen?
  34. The location, size, and bit depth of the screen is different in various machines. You can determine its location and size by examining the QuickDraw global variable screenBits on machines without Color QuickDraw. On machines with Color QuickDraw, the device list, described in the Graphics Devices chapter of Inside Macintosh, tells the location and size and bit depth of each screen, screenBits contains the location and size of the main device, and GrayRgn contains a region describing the shape and size of the desktop.
  35. Does your software fail on some Macintosh models or on A/UX?
  36. If so, you should determine the reason. Failure to run on all versions of the Macintosh may indicate problems which will prevent your software from working on future machines. Failture to run on A/UX, Apple’s Unix for the Macintosh, also may indicate such problems.
  37. Do you change master pointer flags of relocatable blocks directly with BSET or BCLR instructions?
  38. In the future and on A/UX, all 32 bits of a master pointer may be used, with the flags byte moved elsewhere. Use the Memory Manager calls HPurge, HNoPurge, HLock, HUnlock, HSetRBit, HClrRBit, HGetState, and HSetState to manipulate the master pointer flags. (See the Memory Manager chapter of Inside Macintosh Volume IV for information on these calls.)
  39. Do you check for 128K, 512K, and 1M RAM sizes?
  40. You should be flexible enough to allow for non-standard memory sizes. This will allow your software to work in environments like MultiFinder.
  41. Is your software incompatible with a third-party vendor’s hardware?
  42. If so, the incompatibility may prevent your software from working on future machines. You should research the incompatibility and try to determine a solution.
  43. Do you rely on system resources being in RAM?
  44. On most of our systems, some system resources are in ROM. You should not assume, for example, that you can regain RAM space by releasing system resources.
  45. Does your software have timing-sensitive code?
  46. Various Macintoshes run at different clock speeds, so timing loops will be invalid. You can use the trap call Delay for timing, or you can examine the global variable Ticks.
  47. Do you have code which writes to addresses within the code itself?
  48. A memory management unit (MMU) may one day prevent code from writing to addresses within code memory. Also, some microprocessors in the 68000 family cache code as it’s encountered. Your data blocks should be allocated on the stack or in heap blocks separate from the code, and your code should not modify itself.
  49. Do you rely on keyboard key codes rather than ASCII codes?
  50. The various keyboards are slightly different; future keyboards may be different from them. For textual input, you should read ASCII codes rather than key codes.
  51. Do you rely on the format of packed addresses in the trap dispatch table?
  52. The trap dispatch table is different on various Macintoshes. There’s no guarantee of the trap table’s format in the future. You should use the system calls GetTrapAddress and SetTrapAddress to manipulate the trap dispatch table.
  53. Do you use the Resource Manager calls AddReference or RmveReference?
  54. These calls have been removed from the 128K ROM. They are no longer supported.
  55. Do you store information in the application parameters area (the 32 bytes between the application and unit globals and the jump table)?
  56. This space is reserved for use by Apple.
  57. Do you depend on values in registers after a trap call, other than those documented in Inside Macintosh?
  58. These values aren’t guaranteed. The register conventions documented in Inside Macintosh will, of course, be supported. Often, you may not realize that your code is depending on these undocumented values, so check your register usage carefully.
  59. Do you use the IMMED bit in File Manager calls?
  60. This bit, which was documented in early versions of Inside Macintosh as a special form of File Manager call, actually did nothing for File Manager calls, and was used only for Device Manager calls. With the advent of the Hierarchical File System, this bit indicates that the call has a parameter block with hierarchical information.
  61. Do you make assumptions about the number and size of disk drives?
  62. There are now five sizes of Apple disks for the Macintosh (400K, 800K, and 20M, 40M, 80M), as well as many more from third-party vendors. You should use Standard File and File Manager calls to determine the number and size of disk drives.
  63. Do you depend on alternate (page 2) sound or video buffers?
  64. Some Macintoshes do not support alternate sound and video buffers.
  65. Do you print by sending ASCII directly to the printer driver?
  66. To retain compatibility with both locally-connected and AppleTalk-connected printers, you should print using Printing Managerr, as documented in Inside Macintosh.
  67. Does your application fail when it’s the startup application (i.e., without the Finder being run first)?
  68. If so, you’re probably not initializing a variable. If your application does not work as the startup application, you should determine why and fix the problem, since it may cause your application to fail in the future.
  69. º◊#ˇ ˇˇˇˇ#◊†Ç 
  70. .ZÄ#
  71.     0Ià:µú9"z    ˇˇˇˇˇˇˇˇ#†ƒ°d
  72. ONLNf˛†å°d1drw2…-·_ġˇˇˇˇˇè°ñ x°ddrw2:°ddrw2:$°d4drw2:°öˇ˙ó@†ò,Times
  73. .R…R…+]ANew Technical Notes†ô°ddrw2:°„†ó°d1drw2eÙġˇˇˇˇˇP°ñ x°ddrw2:°ddrw2:$°d4drw2:°öˇ˚ÄE¿†ò
  74. (zïDeveloper Support†ô°ddrw2:°„†ó°d`drw2-ÔˇˇˇˇˇˇKÔ- Z  eeZ°d1drw2 ¿˙ÈˇˇˇˇˇˇK°ñ x°ddrw2:°ddrw2:$°d4drw2:0°öˇÙĆò
  75. 0(TÔ†ô°ddrw2:°„†ó°d1drw2ÔÊ˙ˇˇˇˇˇˇ°ñ x°ddrw2:°ddrw2:$°d4drw2:    °öˇ˝Ä†ò
  76.     +&    ®†ô°ddrw2:°„†ó°d1drw2Â-¯yˇˇˇˇˇˇ°ñ x°ddrw2:°ddrw2:$°d4drw2:°öˇ˚Ä%†ò
  77. (Y\    Macintosh†ô°ddrw2:°„†ó†ç°ddrw2D†É
  78. IR.°dONLNdm<˛(öZCompatibility Guidelines
  79. °dONLNd<çu*Overview°dONLNd"çç˛(©´m.ov.compatibility
  80. °dONLNd5ô<•s(¡Z Revised by:°dONLNdAôÑ• )HLouella Pizzuti°dONLNdQôµ•˛(¡”February  1987°dONLNd`•<±r(ÕZ Written by:°dONLNdl•ѱª)H Cary Clark °dONLNdx•æ±˛(Õ‹ January 1986°dONLNdá±ÑΩ«(Ÿ¢Scott Knaster  ËX˰dONLNdó‚<Óp(
  81. Z=Apple has many enhancements planned for the Macintosh family °dONLNd‘‚pÓ˛(
  82. éof computers. To help ensure°dONLNdÒÓ<˙¸(Z)your software’s compatibility with these °dONLNdÓ¸˙˛)¿5enhancements, check each item in this note to be sure°dONLNdP˙<
  83. ("Z*that you’re following the recommendations.°dONLNd{<Ö*FIf your software is written in a high-level language like Pascal or C °dONLNd¡Ö˛(:£and if you adhere to the°dONLNd⁄<*ó(FZguidelines listed in °dONLNdÔó*È)[Inside Macintosh°dONLNdˇÈ*))R, many of the °dONLNd
  84. )*˛)@,questions in this note won’t concern you. If°dONLNd:*<61(RZ2you develop in assembly language, you should read °dONLNdl*16˛)ı*each question carefully. If you answer any°dONLNdó6<Bî(^Zquestion “yes,” °dONLNdß6îB˛)XByour software may encounter difficulty running on future Macintosh°dONLNdÍB<NΩ(jZNcomputers, and you should take the recommended action to change your software.°dONLNd9Z<fô*Do you depend °dONLNdGZôf˛)]<on 68000 instructions which require that the processor be in°dONLNdÑf<rò(éZsupervisor mode?°dONLNdï~<äÔ*%In general, your software should not °dONLNd∫~Ôä˛)≥5include instructions which depend on supervisor mode.°dONLNdä<ñ[(≤ZThese °dONLNdˆä[ñ˛)Uinclude modifying the contents of the status register. Most programs which modify the°dONLNdLñ<¢`(æZ>status register are only changing the Condition Code Register °dONLNdäñ`¢˛(æ~"(CCR) half of the status register,°dONLNd≠¢<Æ›( Z"so an instruction which addresses °dONLNdœ¢›Æ˛)°:the CCR will work fine. Also, your software should not use°dONLNd
  85. Æ<∫R(÷Z;the User Stack Pointer (USP) or turn interrupts on and off.°dONLNdFΔ<“Æ*GDo you have code which executes in response to an exception and relies °dONLNdçΔÆ“˛(ÓÃon the position°dONLNdù“<fi(˙Z-of data in the exception’s local stack frame?°dONLNdÀÍ<ˆ¨*Exception stack frames °dONLNd‚ͨˆ˛)pDvary on different microprocessors in the 68000 family, some of which°dONLNd'˘<‡(!Z may be used in future Macintosh °dONLNdG˘‡¶)§&computers. You should avoid using the ,
  86. Courier°dONLNdmˆ¶ƒ)ΔTRAP°dONLNdq˘ƒ˛)
  87.  instruction.°dONLNd<X(-ZNote:°dONLNdÑXe)5 You can determine which microprocessor is installed °dONLNdπe˛(-Éby examining the low-memory°dONLNd’< \(<Zglobal °dONLNd‹\!è) CPUFlag°dONLNd„è ¿)3  (a byte at °dONLNdÔ¿!fi)1$12F°dONLNdÛfi I)). These are the values:°dONLNd,`8ê(T~CPUFlag°dONLNd,®8˜)Hmicroprocessor°dONLNd'8`Dy(`~  $00°dONLNd.8®DΔ)H68000°dONLNd5D`Py(l~  $01°dONLNd<D®PΔ)H68010°dONLNdCP`\y(x~  $02°dONLNdJP®\Δ)H68020°dONLNdQ\`hy(Ñ~  $03°dONLNdX\®hΔ)H68030 fiXfi
  88. (ÒZCompatibility Guidelines(Ò1) of 5ˇ°¿Ù%%DSIDICT:_cv
  89. currentdict /bu known {bu}if
  90. userdict /_cv known not{userdict /_cv 30 dict put}if
  91. _cv begin
  92. /bdf{bind def}bind def
  93. currentscreen/cs exch def/ca exch def/cf exch def
  94. /setcmykcolor where{/setcmykcolor get /cvcmyk exch def}{/cvcmyk{1 sub 4 1 roll 3{3 index add neg dup 0 lt{pop 0}if 3 1 roll}repeat setrgbcolor pop}bdf }ifelse
  95. /ss{//cf //ca //cs setscreen}bdf
  96. /stg{ss setgray}bdf
  97. /strgb{ss setrgbcolor}bdf
  98. /stcmyk{ss cvcmyk}bdf
  99. /min1{dup 0 eq{pop 1}if}bdf
  100. end
  101. currentdict /bn known {bn}if
  102. †ø◊#ˇ ˇˇˇˇ#◊ 
  103. IR,Times
  104. .+6,Macintosh Technical Notes .4.˘
  105. °dONLNd(%*0Do you use low-memory globals not documented in °dONLNd0%(|(DCInside Macintosh°dONLNd@|(Ç)W?°dONLNdB7C6(_6Other °dONLNdH76C¢)Kmicroprocessors in the 68000 family use the exception vectors in locations ,
  106. Courier°dONLNdì4¢D±(_¿$0°dONLNdï7±C⁄) through°dONLNdûCS-(n6$FF°dONLNd°F-RI)7 in different ways. No undocumented location below the °dONLNdÿFIRê(ng
  107. system heap (°dONLNdÂCêSØ)G$100°dONLNdÈFØR⁄) through°dONLNdÚRb=(}6$13FF°dONLNd˜U=aB)%:) is guaranteed to be available for use in future systems.°dONLNd2myÆ(ï6LDo you make assumptions about the file system which are not consistent with °dONLNd~mÆy⁄(ïÃboth the°dONLNdáyÖn(°6@original Macintosh File System and the Hierarchical File System?°dONLNd»ëù*1Your applications should be compatible with both °dONLNd˘ëù⁄)Î.file systems. The easiest way to do this is to°dONLNd(ù©d(≈6stick to the old °dONLNd9ùd©⁄)LLfiles system trap calls (which work with both file systems) and avoid direct°dONLNdÜ©µ(—65manipulation of data structures such as file control °dONLNdª©µ⁄))blocks and volume control blocks whenever°dONLNdµ¡B(›6    possible.°dONLNdÔÕŸ'*Do°dONLNdÒÕ'Ÿ*) °dONLNdÚÕ*Ÿ=)you°dONLNdıÕ=Ÿ@) °dONLNdˆÕ@Ÿf)depend°dONLNd¸ÕfŸi)& °dONLNd˝ÕiŸv)on°dONLNdˇÕvŸy)
  108.  °dONLNdÕyŸâ)the°dONLNdÕâŸå) °dONLNdÕåŸØ)system°dONLNd
  109. ÕØŸ≤)# °dONLNd Õ≤ŸΩ)or°dONLNd
  110. ÕΩŸ¿)  °dONLNdÕ¿Ÿ¸) application°dONLNdÕ¸Ÿˇ)< °dONLNdÕˇŸ)heaps°dONLNdÕŸ ) °dONLNd Õ ŸI)starting°dONLNd(ÕIŸL)) °dONLNd)ÕLŸV)at°dONLNd+ÕVŸY)
  111.  °dONLNd,ÕYŸù) a hard-coded°dONLNd8ÕùŸ†)D °dONLNd9Õ†ŸŒ)address?°dONLNdBÂÒ    (
  112. 62The starting addresses and the size of the system °dONLNdt    Ò⁄)Ò)and application heaps has already changed°dONLNdûÒ˝¬(6(Macintosh vs. Macintosh Plus) °dONLNdΩÒ¬˝⁄)™3and will change again in the future. Use the global°dONLNdÒ˝
  113. T((6ApplZone°dONLNd˘T c)< to °dONLNd˝c Ú)find the application heap and °dONLNd˝Ú
  114. ()èSysZone°dONLNd"( ⁄)6% to find the system heap. Also, don’t°dONLNdH à(46Pcount on the application heap zone starting at an address less than 65536 (that °dONLNdò à⁄(4¶is, a system heap°dONLNd™$p(@6smaller than 64K).°dONLNdΩ0<*1Do you look through the system’s queues directly?°dONLNdÔHT´*QIn general, you should avoid examining queue elements directly. Instead, use the °dONLNd@H´T⁄(p…    Operating°dONLNdJT`„(|6*System calls to manipulate queue elements.°dONLNdulx'*Do°dONLNdwl'x*) °dONLNdxl*x=)you°dONLNd{l=xA) °dONLNd|lAxi)directly°dONLNdÑlixm)( °dONLNdÖlmxï)address°dONLNdålïxô)( °dONLNdçlôxÒ)
  115. memory-mapped°dONLNdölÒxı)X °dONLNdõlıx')hardware°dONLNd£l'x+)2 °dONLNd§l+xC)such°dONLNd®lCxG) °dONLNd©lGxR)as°dONLNd´lRxV)  °dONLNd¨lVxf)the°dONLNdØlfxj) °dONLNd∞ljxÉ)VIA,°dONLNd¥lÉxá) °dONLNdµláxó)the°dONLNd∏lóxõ) °dONLNdπlõx∑)SCC,°dONLNdΩl∑xª) °dONLNdælªxΔ)or°dONLNd¿lΔx )  °dONLNd¡l x⁄)the°dONLNd≈xÑ9(†6IWM?°dONLNd êú.*You °dONLNdŒê.ú⁄)[should avoid accessing this memory directly and use trap calls instead (disk driver, serial°dONLNd*ú®§(ƒ6Jdriver, etc.). Future machines may include a memory management unit (MMU) °dONLNdtú§®⁄(ƒ¬    which may°dONLNd~®¥=(–6prevent °dONLNdÜ®=¥⁄)%Naccess to memory-mapped hardware. Also, these memory-mapped devices may not be°dONLNd’¥¿A(‹6?present on future machines. The addresses of these devices are °dONLNd¥A¿⁄(‹_ likely to change, so if you must°dONLNd5¿ÃË(Ë6+access the hardware directly, get the base °dONLNd`¿ËÃ÷)–.address of the device from the appropriate low°dONLNdé¿÷Ã⁄)Ó-°dONLNdèÃÿ7(Ù6=memory global (obtainable from includes and interface files):
  116. °dONLNdŒ‰<ÓV+$device°dONLNd÷‰ÑÓü)Hglobal°dONLNd‡Ó<¯L(ZVIA°dONLNdÂÓѯö)H$1D4°dONLNdί<\(ZSCCRd°dONLNdÚ¯®æ)l$1D8°dONLNd¯< \()ZSCCWr°dONLNd˛Ñ ú)H$1DC°dONLNd <Q(3ZIWM°dONLNd     Ñô)H$1E0 fi4fi˘(Ò62) of 5(ÒíCompatibility Guidelinesˇö◊#ˇ ˇˇˇˇ#◊ 
  117. IR,Times
  118. .+Z,Developer Technical Support(,flFebruary  1987 .X.
  119. °dONLNd<(8(DZ1Do you assume the location or size of the screen?°dONLNd24<@‘*RThe location, size, and bit depth of the screen is different in various machines. °dONLNdÑ4‘@˛(\ÚYou can°dONLNdåC<O£(kZdetermine its location °dONLNd£C£O©)g4and size by examining the QuickDraw global variable ,
  120. Courier°dONLNd◊@©PÓ(k«
  121. screenBits°dONLNd·CÓO˛)E on°dONLNdÂO<[ï(wZmachines without °dONLNdˆOï[˛)YCColor QuickDraw. On machines with Color QuickDraw, the device list,°dONLNd:[<gl(ÉZ
  122. described °dONLNdD[lg)0#in the Graphics Devices chapter of °dONLNdg[gj)´Inside Macintosh°dONLNdw[jg˛)S!, tells the location and size and°dONLNdôj<vµ(íZbit depth of each screen, °dONLNd≥gµw˙)y
  123. screenBits°dONLNdΩj˙vÌ)E4 contains the location and size of the main device, °dONLNdÒjÌv˛)Ûand°dONLNdıv<Ür(°ZGrayRgn°dONLNd¸yrÖö)6@ contains a region describing the shape and size of the desktop.°dONLNd=ë<ùà(πZ<Does your software fail on some Macintosh models or on A/UX?°dONLNdz©<µ/*3If so, you should determine the reason. Failure to °dONLNd≠©/µ˛)Û(run on all versions of the Macintosh may°dONLNd÷µ<¡≈(›Zindicate problems which will °dONLNdÛµ≈¡˛)â?prevent your software from working on future machines. Failture°dONLNd3¡<Õƒ(ÈZPto run on A/UX, Apple’s Unix for the Macintosh, also may indicate such problems.°dONLNdÑŸ<™*GDo you change master pointer flags of relocatable blocks directly with °dONLNdÀŸ™Â˛(» BSET or BCLR°dONLNdÿÂ<ÒÅ(
  124. Z
  125. instructions?°dONLNdÊ˝<    “*In the future and on A/UX, all °dONLNd˝“    ˛)ñ<32 bits of a master pointer may be used, with the flags byte°dONLNdB <c(4Zmoved °dONLNdH cS)'(elsewhere. Use the Memory Manager calls °dONLNdp    SÅ)HPurge°dONLNdv Åå)., °dONLNdx    åÀ) HNoPurge°dONLNdÄ À÷)?, °dONLNdÇ    ÷¸) HLock°dONLNdá ¸˛)&,°dONLNdâ<(Æ(CZHUnlock, HSetRBit°dONLNdöÆ'≥)r, °dONLNdú≥(Á)HClrRBit°dONLNd§Á'Ï)4, °dONLNd¶Ï(-)    HGetState°dONLNdØ-'F)A, and °dONLNdµF(Ü)    HSetState°dONLNdæÜ'â)@ °dONLNdøâ'˛)to manipulate the master°dONLNdÿ'<3@(OZ/pointer flags. (See the Memory Manager chapter °dONLNd'@3R(O^of °dONLNd
  126. 'R3Ë)Inside Macintosh Volume IV°dONLNd$'Ë3˛)ñ for°dONLNd)3<?º([Zinformation on these calls.)°dONLNdFK<WB*.Do you check for 128K, 512K, and 1M RAM sizes?°dONLNduc<o¥*KYou should be flexible enough to allow for non-standard memory sizes. This °dONLNd¿c¥o˛(ã“will allow your°dONLNd–o<{,(óZ2software to work in environments like MultiFinder.°dONLNdá<ì§*CIs your software incompatible with a third-party vendor’s hardware?°dONLNdGü<´µ*If so, the incompatibility °dONLNdbüµ´˛)y>may prevent your software from working on future machines. You°dONLNd°´<∑u(”ZDshould research the incompatibility and try to determine a solution.°dONLNdÊ√<œ5*-Do you rely on system resources being in RAM?°dONLNd€<Áx* On most of °dONLNd€xÁ˛)<Iour systems, some system resources are in ROM. You should not assume, for°dONLNdiÁ<Ûè(ZEexample, that you can regain RAM space by releasing system resources.°dONLNdØˇ< 1*.Does your software have timing-sensitive code?°dONLNdfi<#y*CVarious Macintoshes run at different clock speeds, so timing loops °dONLNd!y#˛(?ówill be invalid. You can use°dONLNd>&<2u(NZthe trap call °dONLNdL#u3ô)9Delay°dONLNdQ&ô2á)$4 for timing, or you can examine the global variable °dONLNdÖ#á3ß)ÓTicks°dONLNdä&ß2™) . fiXfi
  127. (ÒZCompatibility Guidelines(Ò3) of 5ˇ ◊#ˇ ˇˇˇˇ#◊ 
  128. IR,Times
  129. .+6,Macintosh Technical Notes .4.˘
  130. °dONLNd(p*BDo you have code which writes to addresses within the code itself?°dONLNdC4@ù*EA memory management unit (MMU) may one day prevent code from writing °dONLNdà4ù@⁄(\ª to addresses°dONLNdï@Lø(h6within code memory. Also, some °dONLNd¥@øL⁄)ß6microprocessors in the 68000 family cache code as it’s°dONLNdÎLXA(t6?encountered. Your data blocks should be allocated on the stack °dONLNd*LAX⁄(t_or in heap blocks separate from°dONLNdJXd˛(Ä61the code, and your code should not modify itself.°dONLNd|p|S*:Do you rely on keyboard key codes rather than ASCII codes?°dONLNd∑àîU*CThe various keyboards are slightly different; future keyboards may °dONLNd˙àUî⁄(∞sbe different from them. For°dONLNdî†M(º6Atextual input, you should read ASCII codes rather than key codes.°dONLNdX¨∏î*IDo you rely on the format of packed addresses in the trap dispatch table?°dONLNd¢ƒ–c*EThe trap dispatch table is different on various Macintoshes. There’s °dONLNdÁƒc–⁄(ÏÅno guarantee of the trap°dONLNd”fl´(˚6table’s format in the future. °dONLNd”´fl\)ì You should use the system calls ,
  131. Courier°dONLNd>–\‡¬)±GetTrapAddress°dONLNdL”¬fl⁄)f and°dONLNdQflÔ}(
  132. 6SetTrapAddress°dONLNd_‚}Ó+)e' to manipulate the trap dispatch table.°dONLNdá˝    Â(%6&Do you use the Resource Manager calls °dONLNd≠˙Â
  133. @)Õ AddReference°dONLNdπ˝@    Q)[ or °dONLNdΩ˙Q
  134. ∏)
  135. RmveReference°dONLNd ˝∏    æ)g?°dONLNdÃ!§(=6NThese calls have been removed from the 128K ROM. They are no longer supported.°dONLNd-9T*<Do you store information in the application parameters area °dONLNdW-T9⁄(Ur(the 32 bytes between the°dONLNdq9E(a61application and unit globals and the jump table)?°dONLNd£Q]‘*(This space is reserved for use by Apple.°dONLNdÃiu˛*-Do you depend on values in registers after a °dONLNd˘i˛u⁄)Ê)trap call, other than those documented in°dONLNd#uÅo(ù6Inside Macintosh°dONLNd3uoÅu)W?°dONLNd5çôÍ(µ6-These values aren’t guaranteed. The register °dONLNdbçÍôp)“conventions documented in °dONLNd|çpô√)ÜInside Macintosh°dONLNdåç√ô⁄)S will,°dONLNdìô•3(¡69of course, be supported. Often, you may not realize that °dONLNdÃô3•⁄(¡Qyour code is depending on these°dONLNdÏ•±7(Õ6<undocumented values, so check your register usage carefully.°dONLNd)Ω…*/Do you use the IMMED bit in File Manager calls?°dONLNdY’·*4This bit, which was documented in early versions of °dONLNdç’·.)ˆInside °dONLNdî’.·`)     Macintosh°dONLNdù’`·⁄)2 as a special form of File°dONLNd∏·Ì^(    6Manager call, °dONLNdΔ·^Ì⁄)FIactually did nothing for File Manager calls, and was used only for Device°dONLNdÌ˘s(6IManager calls. With the advent of the Hierarchical File System, this bit °dONLNdYÌs˘⁄(ëindicates that the call°dONLNdq˘ (!64has a parameter block with hierarchical information.°dONLNd¶*ADo you make assumptions about the number and size of disk drives?°dONLNdË)5É*KThere are now five sizes of Apple disks for the Macintosh (400K, 800K, and °dONLNd3)É5⁄(Q°20M, 40M, 80M),°dONLNdC5Aó(]6Gas well as many more from third-party vendors. You should use Standard °dONLNdä5óA⁄(]µ
  136. File and File°dONLNdòAM>(i6>Manager calls to determine the number and size of disk drives. fi4fi˘
  137. *à4) of 5(ÒíCompatibility Guidelinesˇö◊#ˇ ˇˇˇˇ#◊ 
  138. IR,Times
  139. .+Z,Developer Technical Support(,flFebruary  1987 .X.
  140. °dONLNd<(w(DZ;Do you depend on alternate (page 2) sound or video buffers?°dONLNd<4<@Ä*BSome Macintoshes do not support alternate sound and video buffers.°dONLNdL<X{*=Do you print by sending ASCII directly to the printer driver?°dONLNdΩd<pÏ*VTo retain compatibility with both locally-connected and AppleTalk-connected printers, °dONLNddÏp˛(å
  141. you°dONLNdp<|F(òZ7should print using Printing Managerr, as documented in °dONLNdNpF|ò(òdInside Macintosh°dONLNd^pò|õ)R.°dONLNd`à<îΔ(∞ZLDoes your application fail when it’s the startup application (i.e., without °dONLNd¨àΔî˛(∞‰
  142. the Finder°dONLNd∑î<†ì(ºZbeing run first)?°dONLNd…¨<∏Ã*YIf so, you’re probably not initializing a variable. If your application does not work as °dONLNd"¨Ã∏˛(‘Í the startup°dONLNd.∏<ƒU(‡Z;application, you should determine why and fix the problem, °dONLNdi∏Uƒ˛(‡s#since it may cause your application°dONLNdçƒ<–ñ(ÏZto fail in the future. fiXfi
  143. (ÒZCompatibility Guidelines(Ò5) of 5ˇ